package com.zy.web.demo.duoxiancheng.demo14;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/8/17 14:02
 */
public class ThreadB14 extends Thread{

    private MyList16 list;

    public ThreadB14(MyList16 list ){
        super();
        this.list = list;
    }

    @Override
    public void run() {
       try {
           while (true){
               if (list.size() == 5){
                   System.out.println("==5了,线程b要退出");
                   throw new InterruptedException();
               }
           }
       }catch (InterruptedException e){
           e.printStackTrace();
       }
    }
}
